Integrand size = 19, antiderivative size = 111 \[ \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx=\frac {6 b^2 x \cos (c+d x)}{d^3}-\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+a^2 \operatorname {CosIntegral}(d x) \sin (c)-\frac {6 b^2 \sin (c+d x)}{d^4}+\frac {2 a b \sin (c+d x)}{d^2}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text {Si}(d x) \]
[Out]
Time = 0.23 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {3420, 3384, 3380, 3383, 3377, 2717} \[ \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx=a^2 \sin (c) \operatorname {CosIntegral}(d x)+a^2 \cos (c) \text {Si}(d x)+\frac {2 a b \sin (c+d x)}{d^2}-\frac {2 a b x \cos (c+d x)}{d}-\frac {6 b^2 \sin (c+d x)}{d^4}+\frac {6 b^2 x \cos (c+d x)}{d^3}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}-\frac {b^2 x^3 \cos (c+d x)}{d} \]
[In]
[Out]
Rule 2717
Rule 3377
Rule 3380
Rule 3383
Rule 3384
Rule 3420
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {a^2 \sin (c+d x)}{x}+2 a b x \sin (c+d x)+b^2 x^3 \sin (c+d x)\right ) \, dx \\ & = a^2 \int \frac {\sin (c+d x)}{x} \, dx+(2 a b) \int x \sin (c+d x) \, dx+b^2 \int x^3 \sin (c+d x) \, dx \\ & = -\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+\frac {(2 a b) \int \cos (c+d x) \, dx}{d}+\frac {\left (3 b^2\right ) \int x^2 \cos (c+d x) \, dx}{d}+\left (a^2 \cos (c)\right ) \int \frac {\sin (d x)}{x} \, dx+\left (a^2 \sin (c)\right ) \int \frac {\cos (d x)}{x} \, dx \\ & = -\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+a^2 \operatorname {CosIntegral}(d x) \sin (c)+\frac {2 a b \sin (c+d x)}{d^2}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text {Si}(d x)-\frac {\left (6 b^2\right ) \int x \sin (c+d x) \, dx}{d^2} \\ & = \frac {6 b^2 x \cos (c+d x)}{d^3}-\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+a^2 \operatorname {CosIntegral}(d x) \sin (c)+\frac {2 a b \sin (c+d x)}{d^2}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text {Si}(d x)-\frac {\left (6 b^2\right ) \int \cos (c+d x) \, dx}{d^3} \\ & = \frac {6 b^2 x \cos (c+d x)}{d^3}-\frac {2 a b x \cos (c+d x)}{d}-\frac {b^2 x^3 \cos (c+d x)}{d}+a^2 \operatorname {CosIntegral}(d x) \sin (c)-\frac {6 b^2 \sin (c+d x)}{d^4}+\frac {2 a b \sin (c+d x)}{d^2}+\frac {3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text {Si}(d x) \\ \end{align*}
Time = 0.27 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.74 \[ \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx=-\frac {b x \left (2 a d^2+b \left (-6+d^2 x^2\right )\right ) \cos (c+d x)}{d^3}+a^2 \operatorname {CosIntegral}(d x) \sin (c)+\frac {b \left (2 a d^2+3 b \left (-2+d^2 x^2\right )\right ) \sin (c+d x)}{d^4}+a^2 \cos (c) \text {Si}(d x) \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.32 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.15
method | result | size |
risch | \(-\frac {b^{2} x^{3} \cos \left (d x +c \right )}{d}+\frac {i a^{2} {\mathrm e}^{i c} \operatorname {Ei}_{1}\left (-i d x \right )}{2}-\frac {i a^{2} {\mathrm e}^{-i c} \operatorname {Ei}_{1}\left (i d x \right )}{2}+\frac {3 b^{2} x^{2} \sin \left (d x +c \right )}{d^{2}}-\frac {2 a b x \cos \left (d x +c \right )}{d}+\frac {2 a b \sin \left (d x +c \right )}{d^{2}}+\frac {6 b^{2} x \cos \left (d x +c \right )}{d^{3}}-\frac {6 b^{2} \sin \left (d x +c \right )}{d^{4}}\) | \(128\) |
derivativedivides | \(a^{2} \left (\operatorname {Si}\left (d x \right ) \cos \left (c \right )+\operatorname {Ci}\left (d x \right ) \sin \left (c \right )\right )+\frac {4 a b c \cos \left (d x +c \right )}{d^{2}}+\frac {2 \left (c +1\right ) a b \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{2}}+\frac {4 b^{2} c^{3} \cos \left (d x +c \right )}{d^{4}}+\frac {6 \left (c +1\right ) b^{2} c^{2} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}-\frac {4 b^{2} c \left (c^{2}+c +1\right ) \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}+\frac {\left (c^{3}+c^{2}+c +1\right ) b^{2} \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}\) | \(236\) |
default | \(a^{2} \left (\operatorname {Si}\left (d x \right ) \cos \left (c \right )+\operatorname {Ci}\left (d x \right ) \sin \left (c \right )\right )+\frac {4 a b c \cos \left (d x +c \right )}{d^{2}}+\frac {2 \left (c +1\right ) a b \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{2}}+\frac {4 b^{2} c^{3} \cos \left (d x +c \right )}{d^{4}}+\frac {6 \left (c +1\right ) b^{2} c^{2} \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}-\frac {4 b^{2} c \left (c^{2}+c +1\right ) \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{4}}+\frac {\left (c^{3}+c^{2}+c +1\right ) b^{2} \left (-\left (d x +c \right )^{3} \cos \left (d x +c \right )+3 \left (d x +c \right )^{2} \sin \left (d x +c \right )-6 \sin \left (d x +c \right )+6 \cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{4}}\) | \(236\) |
meijerg | \(\frac {8 b^{2} \sqrt {\pi }\, \sin \left (c \right ) \left (\frac {3}{4 \sqrt {\pi }}-\frac {\left (-\frac {3 d^{2} x^{2}}{2}+3\right ) \cos \left (d x \right )}{4 \sqrt {\pi }}-\frac {d x \left (-\frac {d^{2} x^{2}}{2}+3\right ) \sin \left (d x \right )}{4 \sqrt {\pi }}\right )}{d^{4}}+\frac {8 b^{2} \sqrt {\pi }\, \cos \left (c \right ) \left (\frac {x d \left (-\frac {5 d^{2} x^{2}}{2}+15\right ) \cos \left (d x \right )}{20 \sqrt {\pi }}-\frac {\left (-\frac {15 d^{2} x^{2}}{2}+15\right ) \sin \left (d x \right )}{20 \sqrt {\pi }}\right )}{d^{4}}+\frac {4 a b \sqrt {\pi }\, \sin \left (c \right ) \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\cos \left (d x \right )}{2 \sqrt {\pi }}+\frac {d x \sin \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{2}}+\frac {4 a b \sqrt {\pi }\, \cos \left (c \right ) \left (-\frac {d x \cos \left (d x \right )}{2 \sqrt {\pi }}+\frac {\sin \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{2}}+\frac {a^{2} \sqrt {\pi }\, \sin \left (c \right ) \left (\frac {2 \gamma +2 \ln \left (x \right )+\ln \left (d^{2}\right )}{\sqrt {\pi }}-\frac {2 \gamma }{\sqrt {\pi }}-\frac {2 \ln \left (2\right )}{\sqrt {\pi }}-\frac {2 \ln \left (\frac {d x}{2}\right )}{\sqrt {\pi }}+\frac {2 \,\operatorname {Ci}\left (d x \right )}{\sqrt {\pi }}\right )}{2}+a^{2} \cos \left (c \right ) \operatorname {Si}\left (d x \right )\) | \(255\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.87 \[ \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx=\frac {a^{2} d^{4} \operatorname {Ci}\left (d x\right ) \sin \left (c\right ) + a^{2} d^{4} \cos \left (c\right ) \operatorname {Si}\left (d x\right ) - {\left (b^{2} d^{3} x^{3} + 2 \, {\left (a b d^{3} - 3 \, b^{2} d\right )} x\right )} \cos \left (d x + c\right ) + {\left (3 \, b^{2} d^{2} x^{2} + 2 \, a b d^{2} - 6 \, b^{2}\right )} \sin \left (d x + c\right )}{d^{4}} \]
[In]
[Out]
Time = 2.49 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.44 \[ \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx=a^{2} \sin {\left (c \right )} \operatorname {Ci}{\left (d x \right )} + a^{2} \cos {\left (c \right )} \operatorname {Si}{\left (d x \right )} + 2 a b x \left (\begin {cases} x \sin {\left (c \right )} & \text {for}\: d = 0 \\- \frac {\cos {\left (c + d x \right )}}{d} & \text {otherwise} \end {cases}\right ) - 2 a b \left (\begin {cases} \frac {x^{2} \sin {\left (c \right )}}{2} & \text {for}\: d = 0 \\- \frac {\begin {cases} \frac {\sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \cos {\left (c \right )} & \text {otherwise} \end {cases}}{d} & \text {otherwise} \end {cases}\right ) + b^{2} x^{3} \left (\begin {cases} x \sin {\left (c \right )} & \text {for}\: d = 0 \\- \frac {\cos {\left (c + d x \right )}}{d} & \text {otherwise} \end {cases}\right ) - 3 b^{2} \left (\begin {cases} \frac {x^{4} \sin {\left (c \right )}}{4} & \text {for}\: d = 0 \\- \frac {\begin {cases} \frac {x^{2} \sin {\left (c + d x \right )}}{d} + \frac {2 x \cos {\left (c + d x \right )}}{d^{2}} - \frac {2 \sin {\left (c + d x \right )}}{d^{3}} & \text {for}\: d \neq 0 \\\frac {x^{3} \cos {\left (c \right )}}{3} & \text {otherwise} \end {cases}}{d} & \text {otherwise} \end {cases}\right ) \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 1.38 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.05 \[ \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx=\frac {{\left (a^{2} {\left (-i \, {\rm Ei}\left (i \, d x\right ) + i \, {\rm Ei}\left (-i \, d x\right )\right )} \cos \left (c\right ) + a^{2} {\left ({\rm Ei}\left (i \, d x\right ) + {\rm Ei}\left (-i \, d x\right )\right )} \sin \left (c\right )\right )} d^{4} - 2 \, {\left (b^{2} d^{3} x^{3} + 2 \, {\left (a b d^{3} - 3 \, b^{2} d\right )} x\right )} \cos \left (d x + c\right ) + 2 \, {\left (3 \, b^{2} d^{2} x^{2} + 2 \, a b d^{2} - 6 \, b^{2}\right )} \sin \left (d x + c\right )}{2 \, d^{4}} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.31 (sec) , antiderivative size = 725, normalized size of antiderivative = 6.53 \[ \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx=\text {Too large to display} \]
[In]
[Out]
Timed out. \[ \int \frac {\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx=\int \frac {\sin \left (c+d\,x\right )\,{\left (b\,x^2+a\right )}^2}{x} \,d x \]
[In]
[Out]